package models

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

type Video struct {
	Id     int    `json:"id"`
	Sp     int    `json:"sp"`
	Name   string `json:"name"`
	Js     string `json:"js"`
	Img    string `json:"img"`
	Time   string `json:"time"`
	People string `json:"people"`
}

var DB *gorm.DB

func init() {
	dsn := "root:root@tcp(127.0.0.1:3306)/day08"
	var err error
	DB, err = gorm.Open(mysql.Open(dsn))
	if err != nil {
		panic("数据库连接失败")
	}
}
